package com.compass.doctor.ui.home.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import com.compass.doctor.databinding.LayoutDrugItemBinding
import com.compass.doctor.databinding.LayoutRoutineDrugBinding
import com.compass.framework.adapter.BaseBindViewHolder
import com.compass.framework.adapter.BaseRecyclerViewAdapter
import com.compass.framework.model.DrugTabItem
import com.compass.framework.utils.ViewUtils
import com.compass.framework.utils.dpToPx

/**
 * Description： 常用药adapter
 * Date:2023/12/8 9:13
 */
class RoutineDrugAdapter  : BaseRecyclerViewAdapter<DrugTabItem, LayoutRoutineDrugBinding>() {
    override fun onBindDefViewHolder(
        holder: BaseBindViewHolder<LayoutRoutineDrugBinding>,
        item: DrugTabItem?,
        position: Int
    ) {
        if (item == null) return
        holder.binding.apply {
            tvTitle.text = item?.name
            ViewUtils.setClipViewCornerRadius(imgDoctorHead, dpToPx(5))
            tvPrice.text = "19.89"
        }
    }

    override fun getViewBinding(
        layoutInflater: LayoutInflater,
        parent: ViewGroup,
        viewType: Int
    ): LayoutRoutineDrugBinding {
        return LayoutRoutineDrugBinding.inflate(layoutInflater, parent, false)
    }
}